

setInterval(() => {
    deBounce(fn, 3000)
}, 1000)

function fn() {
    console.log(1)
}

const deBounce = (fn, time) => {
    let timer = null
    return function (...args) {
        let _this = this;
        if (timer) {
            clearTimeout(timer)
            timer = null
        }
        timer = setTimeout(() => {
            fn.apply(_this, args)
        }, time)
    }
}